Since the early days of the Web, web application developers have aspired todevelop much of their applications declaratively. However, one aspect of theapplication, namely its business-logic is constantly left imperative. In thiswork we present Application Embedding, a novel approach to applicationdevelopment which allows all aspects of an application, including itsbusiness-logic, to be programmed declaratively. We develop this approach in a two-step process. First, we draw a mappingbetween web applications and Domain-Specific Languages (DSLs). Second, we notethat out of the two methods for implementing DSLs, namely as either internal orexternal, most traditional web applications correspond to external DSLs, whilethe the technique that corresponds to DSL embedding (implementing internalDSLs) is left mostly unexplored. By projecting the well-known technique of DSL embedding onto webapplications, we derive a novel technique--Application Embedding. Applicationembedding offers a separation of code assets that encourages reuse ofimperative code, while keeping all application-specific assets, including thosespecifying its business- logic, declarative. As validation, we implemented a simple, though nontrivial web applicationusing the proposed separation of assets. This implementation includes anapplication-agnostic imperative host application named FishTank, intended to beapplicable for a wide variety of web applications, and a declarative definitionof the different aspects of the specific application, intended to be loaded onthat host. Our method of separation of code assets facilitates a better separation ofwork, in comparison to traditional methods. By this separation, hostapplication developers can focus mostly on the extra-functional aspects of aweb application, namely on improving performance, scalability, andavailability, while developers of an embedded application can focus on thefunctional aspects of their application, without worrying about extra-functional concerns. The reusability of the host application makes the effortput into a better implementation cost-effective, since it can benefit allapplications built on top of it.
展开▼